package com.pek.control.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pek.control.dao.ConfigMapper;
import com.pek.control.dao.UserMapper;
import com.pek.control.entity.ConfigEntity;
import com.pek.control.entity.UserEntity;
import com.pek.control.service.IConfigService;
import com.pek.control.service.IUserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements IUserService {

    @Override
    public UserEntity getUser(String username) {
        return this.getOne(new LambdaQueryWrapper<UserEntity>()
                .eq(UserEntity::getUsername,username)
        );
    }

    @Override
    public UserEntity getUser(String username, String password) {
        return this.getOne(new LambdaQueryWrapper<UserEntity>()
                .eq(UserEntity::getUsername,username)
                .eq(UserEntity::getPassword,password)
        );
    }
}
